package com.fqgj.sentry.policy.engine.domain.enums;

import java.io.Serializable;

/**
 * Created by kennykong on 2017/7/20.
 */
public enum RuleComposeEnum implements Serializable {
    /**
     * 规则的组合方式:首次匹配|最坏匹配|权重匹配
     */

    FIRST, WORST, WEIGHT;


    public static RuleComposeEnum transformByType(Integer type) {
        for (RuleComposeEnum ruleComposeEnum : RuleComposeEnum.values()) {
            if (ruleComposeEnum.ordinal() + 1 == type) {
                return ruleComposeEnum;
            }
        }
        return null;
    }

    public static void main(String[] args) {
        RuleComposeEnum ruleComposeEnum = transformByType(2);
        System.out.println();
    }
}
